#ifndef __MLOG_H
#define __MLOG_H
//使用的头文件
#include <iostream>
#include <string>
#include <sstream>

#include <log4cpp/Category.hh>

#include <log4cpp/Appender.hh>
#include <log4cpp/FileAppender.hh>
#include <log4cpp/OstreamAppender.hh>
#include <log4cpp/RollingFileAppender.hh>

#include <log4cpp/Layout.hh>
#include <log4cpp/PatternLayout.hh>

using namespace log4cpp;
using namespace std;

//类结构的声明
class MLog{
public:
    static MLog* logCntl(const bool flag,const string& FileName,
                         const size_t& fileSize = 10*1024*1024,const int& RollingFileNum = 10,
                         const int& PRIORITY = Priority::DEBUG);

    int getPriority()const;
    void setpriority(int PRIORITY);

    void logInfo(const string& msg)const;
    void logError(const string& msg)const;
    void logWarn(const string& msg)const;
    void logDebug(const string& msg)const;

private:
    Category& root = Category::getRoot();
    MLog(const string& FileName,const int& RollingFileNum,const size_t& fileSize,const int& PRIORITY);
    ~MLog();

};
/*
    mlog->logDebug("this is a Debug msg"); 
    mlog->logInfo("this is an Info msg"); 
    mlog->logError("this is an Error msg"); 
    mlog->logWarn("this is a Warn msg");
*/
#endif

